/*
 * @Descripttion:
 * @LastEditors: xzh
 * @LastEditTime: 2023-09-11 17:45:14
 */
import type { object_Inf } from "@/utils/typings/index.type";
import request from "@/utils/request";
import moldBaseInfo_APi from "../moldBaseInfo";
/*
 * @Descripttion:模具维修接口类
 * @LastEditors: xzh
 * @LastEditTime: 2023-09-07 09:33:57
 */
export default class moldRepair_APi extends moldBaseInfo_APi {
  //#region 模具维修类型接口

  /**
   * @Author: xzh
   * @Descripttion:保存模具维修信息
   * @Param:
   * @param {object} data
   */
  static saveMoldRepairType = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/MouldRepairType/SaveMouldRepairType",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除模具维修类型信息
   * @Param:
   * @param {Array} data
   */
  static deleteMoldRepairType = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/MouldRepairType/DeleteMouldRepairType",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 修改模具维修类型状态
   * @Param:
   * @param {Array} data
   */
  static updateMoldRepairTypeStatus = (
    data: Array<string>,
    status: boolean
  ): Promise<object_Inf> =>
    request({
      url: "/api/MouldRepairType/UpdateMouldRepairTypeStatus",
      method: "post",
      data: {
        ids: data,
        status,
      },
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取模具维修类型信息
   * @Param:
   * @param {number} id 模具维修主键
   */
  static getMoldRepairTypeInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/MouldRepairType/GetMouldRepairType",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取模具维修类型列表
   * @Param:
   */
  static getMoldRepairTypeList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<Array<object_Inf>> =>
    request({
      url: "/api/MouldRepairType/GetMouldRepairTypeList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });

  //#endregion

  //#region 模具维修记录接口

  /**
   * @Author: xzh
   * @Descripttion:保存模具维修记录信息
   * @Param:
   * @param {object} data
   */
  static saveMoldRepairRecord = (data: object): Promise<object_Inf> =>
    request({
      url: "/api/MouldRepairRecord/SaveMouldRepairRecord",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 删除模具维修记录信息
   * @Param:
   * @param {Array} data
   */
  static deleteMoldRepairRecord = (data: Array<string>): Promise<object_Inf> =>
    request({
      url: "/api/MouldRepairRecord/DeleteMouldRepairRecord",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });
  /**
   * @Author: xzh
   * @Descripttion: 获取模具维修记录信息
   * @Param:
   * @param {number} id 模具维修记录主键
   */
  static getMoldRepairRecordInfo = (id: number): Promise<object_Inf> =>
    request({
      url: "/api/MouldRepairRecord/GetMouldRepairRecord",
      method: "get",
      params: { id },
    });
  /**
   * @Author: xzh
   * @Descripttion:获取模具维修记录列表
   * @Param:
   */
  static getMoldRepairRecordList = (
    data: object_Inf = {
      keyWord: "",
    }
  ): Promise<object_Inf> =>
    request({
      url: "/api/MouldRepairRecord/GetMouldRepairRecordList",
      method: "post",
      data,
      headers: { "Content-Type": "application/json;charset=UTF-8" },
    });

  //#endregion
}
